package com.hbnu.commonclass;

/**
 * @author kittychen
 * @since 2025-09-24 16:37
 */
public class ObjectDemo01 {

    public static void main(String[] args) {
        // 1、toString()方法
        User user = new User("kittychen", 20);
//        System.out.println(user.toString());
        System.out.println(user);

        // 2、equals()方法
        User user1 = new User("kittychen", 20);
        System.out.println(user == user1);   // false
        System.out.println(user.equals(user));
    }
}
